home *** CD-ROM | disk | FTP | other *** search
/ PC World 2002 May / PCWorld_2002-05_cd.bin / Novinky / grada / Aplikace / Otazky.dxr / 00101_Ovládání menu.ls < prev    next >
Encoding:
Text File  |  2002-04-14  |  1.5 KB  |  55 lines

  1. property Index_x, Old_x, Posun
  2. global LVyber, SVyber, Posledni_menu
  3.  
  4. on getPropertyDescriptionList
  5.   set description to [:]
  6.   addProp(description, #Posun, [#comment: "Posun:", #format: #integer, #default: 1])
  7.   return description
  8. end
  9.  
  10. on getBehaviorDescription
  11.   return "N├íjezd a klik"
  12. end
  13.  
  14. on beginSprite me
  15.   set the visible of sprite the spriteNum of me to 1
  16.   set Posledni_menu to the frameLabel
  17.   set the locV of sprite (the spriteNum of me + 1) to (LVyber * 16) + 79
  18.   if SVyber = Posledni_menu then
  19.     set the visible of sprite (the spriteNum of me + 1) to 1
  20.   else
  21.     set the visible of sprite (the spriteNum of me + 1) to 0
  22.   end if
  23. end
  24.  
  25. on mouseWithin me
  26.   set Index_x to integer((the mouseV - 66) / 16)
  27.   if (Index_x > 0) and (Index_x < 29) then
  28.     set the cursor of sprite the spriteNum of me to [member "ruka_1", member "ruka_2"]
  29.     set the locV of sprite (the spriteNum of me + 1) to (Index_x * 16) + 79
  30.     set the visible of sprite (the spriteNum of me + 1) to 1
  31.     set Old_x to Index_x
  32.   else
  33.     set the cursor of sprite the spriteNum of me to -1
  34.   end if
  35. end
  36.  
  37. on mouseLeave me
  38.   set the locV of sprite (the spriteNum of me + 1) to (LVyber * 16) + 79
  39.   if SVyber = Posledni_menu then
  40.     set the visible of sprite (the spriteNum of me + 1) to 1
  41.   else
  42.     set the visible of sprite (the spriteNum of me + 1) to 0
  43.   end if
  44. end
  45.  
  46. on mouseDown me
  47.   puppetSound(1, "Klik")
  48. end
  49.  
  50. on mouseUp me
  51.   set LVyber to Old_x
  52.   set SVyber to Posledni_menu
  53.   go(string(Index_x + Posun - 1))
  54. end
  55.